module Ripper {
  
  exception EncodingFailException {
    string reason;
  };

  sequence<byte> ByteSeq;
  sequence<short> Samples;

  interface Mp3Encoder {
    // Input: PCM samples for left and right channels.
    // Output: MP3 frame(s).
    ByteSeq encode (Samples leftSamples, Samples rightSamples)
	throws EncodingFailException;
    // You must flush to get the last frame(s).
    // Flush also destroys the encoder object.
    ByteSeq flush()
	throws EncodingFailException;
  };

  interface Mp3EncoderFactory {
    Mp3Encoder* createEncoder();
  };

};